package com.apex.crm.utils;

import java.security.MessageDigest;
import java.util.Base64;

/**
 * @author XiaoYang
 * @version 1.0
 * @program: crm
 * @Classname Md5Util
 * @description TODO
 * @date 2021/4/20 18:09
 */

public class Md5Util {

    public static String encode(String msg){
        try{
            MessageDigest messageDigest=MessageDigest.getInstance("md5");
            return Base64.getEncoder().encodeToString(messageDigest.digest(msg.getBytes()));
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }


}
